//
//  GKBookCell.swift
//  MySwiftObject
//
//  Created by wangws1990 on 2019/9/9.
//  Copyright © 2019 wangws1990. All rights reserved.
//

import UIKit

class GKBookCell: UICollectionViewCell {
    @IBOutlet weak var imageV: UIImageView!
    @IBOutlet weak var titleLab: UILabel!
    @IBOutlet weak var subTitleLab: UILabel!
    @IBOutlet weak var statebtn: UIButton!
    var _model:GKBookModel!
    var model:GKBookModel{
        set{
            _model = newValue;
            self.imageV.setGkImageWithURL(url: _model.cover ?? "");
            
            self.titleLab.text = _model.title ?? "";
            self.subTitleLab.text = _model.author ?? "";
            self.statebtn .setTitle(_model.minorCate ?? "", for: .normal);
            if _model.minorCate != nil {
                self.statebtn.isHidden = _model.minorCate.count == 0
            }
            
        }get{
            return _model;
        }
    }
    override func awakeFromNib() {
        super.awakeFromNib()
        self.statebtn.layer.masksToBounds = true;
        self.statebtn.layer.cornerRadius = 7.5;
        self.imageV.layer.masksToBounds = true;
        self.imageV.layer.cornerRadius = AppRadius
        // Initialization code
    }

}
